home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sun4c / archive / tcltk.z / tcltk / man / cat3 / AppInit.3 < prev    next >
Text File  |  1994-09-20  |  2KB  |  67 lines

  1.  
  2.  
  3.  
  4. Tcl_AppInit(3)       Tcl Library Procedures                   7.0
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NAME
  11.      Tcl_AppInit - Perform application-specific initialization
  12.  
  13. SYNOPSIS
  14.      #include <tcl.h>
  15.  
  16.      Tcl_AppInit(_i_n_t_e_r_p)
  17.  
  18. ARGUMENTS
  19.      Tcl_Interp   *_i_n_t_e_r_p   (in)      Interpreter for the  appli-
  20.                                       cation.
  21. _________________________________________________________________
  22.  
  23.  
  24. DESCRIPTION
  25.      Tcl_AppInit is a procedure that is invoked by the main  pro-
  26.      grams for Tcl applications such as tclsh and wish.  Its pur-
  27.      pose is to allow new Tcl applications to be created  without
  28.      modifying existing main programs such as those for tclsh and
  29.      wish.  To create a new application simply write a  new  ver-
  30.      sion  of Tcl_AppInit to replace the default version provided
  31.      by Tcl, then link your new Tcl_AppInit with the Tcl library,
  32.      which  contains  the  main  program  from  tclsh (be sure to
  33.      specify the switch ``-u _main'' to the linker to force it to
  34.      use the version of main from the Tcl library).
  35.  
  36.      Tcl_AppInit is invoked after other  initialization  in  main
  37.      and before entering the main loop to process commands.  Here
  38.      are some examples of things that Tcl_AppInit might do:
  39.  
  40.      [1]  Call initialization  procedures  for  various  packages
  41.           used by the application.  Each initialization procedure
  42.           adds new commands to _i_n_t_e_r_p for its  package  and  per-
  43.           forms other package-specific initialization.
  44.  
  45.      [2]  Process command-line arguments, which can  be  accessed
  46.           from the Tcl variables argv and argv0 in _i_n_t_e_r_p.
  47.  
  48.      [3]  Invoke a startup script to initialize the application.
  49.  
  50.  
  51. KEYWORDS
  52.      application, argument, command, initialization, interpreter
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. Tcl                                                             1
  64.  
  65.  
  66.  
  67.